package com.game.league.task.detail.adapter;

import android.app.Activity;

import com.game.base.app.base.BaseAdapter;
import com.game.league.R;
import com.game.league.databinding.AdapterTaskStepBinding;

/**
 * 详细步骤
 * Created by Su on 2019/6/6.
 */
public class StepDetailAdapter extends BaseAdapter<String, AdapterTaskStepBinding> {
    private int type;   // 1=任务须知   2 = 详细步骤

    public StepDetailAdapter(Activity activity, int type) {
        super(activity);
        this.type = type;
    }

    @Override
    protected int getLayoutResId(int viewType) {
        return R.layout.adapter_task_step;
    }

    @Override
    protected void onBindItem(AdapterTaskStepBinding binding, String item, int position) {
        binding.tvStep.setText(item);
        binding.tvStep.setTextColor(type == 1 ? mActivity.getResources().getColor(R.color.text_red) :
                mActivity.getResources().getColor(R.color.black));
    }
}
